package manager.analysis;
import java.util.ArrayList;

import manager.data.RawDataObject;

public class DataAnalysis{


	private ArrayList<Validation> vl;
	private static DataAnalysis instance;

	public DataAnalysis(){
		vl = new ArrayList<Validation>();
		Validation v1=	new ValueControl(); 
		Validation v2= 	new SizeControl();
		Validation v3= new SemanticControl();
		vl.add(v1);
		vl.add(v2);
		vl.add(v3);
	}

	public boolean isValid(RawDataObject dpo) {
		for(int i=0;i<vl.size();i++)
			if(!vl.get(i).validate(dpo))
				return false;
		return true;
	}
	
	public static synchronized DataAnalysis getInstance(){
		if(instance==null)
			instance=new DataAnalysis();
		return instance;
	} 
	
	
}
